package com.gy.serivce.impl;

import com.gy.entity.*;
import com.gy.entity.Error;
import com.gy.mapper.DataMapper;
import com.gy.serivce.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DataServiceImpl implements DataService {

    @Autowired
    private DataMapper dataMapper;

    @Override
    public User login(String username, String password) {
        return dataMapper.login(username, password);
    }

    @Override
    public void register(String username, String password) {
        dataMapper.register(username, password);
    }

    @Override
    public List<Question> getQuestion(String type) {
        return dataMapper.getQuestion(type);
    }

    @Override
    public User searchByUsername(String username) {
        return dataMapper.searchByUsername(username);
    }

    @Override
    public void collect(String questionId, String userId) {
        dataMapper.collect(questionId, userId);
    }

    @Override
    public Collect searchCollect(String questionId, String userId) {
        return dataMapper.searchCollect(questionId, userId);
    }

    @Override
    public Error searchError(String questionId, String userId) {
        return dataMapper.searchError(questionId, userId);
    }

    @Override
    public void error(String questionId, String userId) {
        dataMapper.error(questionId, userId);
    }

    @Override
    public List<Question> selectAllQuestion() {
        return dataMapper.selectAllQuestion();
    }

    @Override
    public void delete(Integer id) {
        dataMapper.delete(id);
    }

    @Override
    public void add(Question question) {
        dataMapper.add(question);
    }

    @Override
    public Question searchQuestById(Integer id) {
        return dataMapper.searchQuestById(id);
    }

    @Override
    public void save(Question question) {
        dataMapper.save(question);
    }

    @Override
    public User adminLogin(String username, String password) {
        return dataMapper.adminLogin(username, password);
    }

    @Override
    public List<Question> searchCollectByUser(String userId) {
        return dataMapper.searchCollectByUser(userId);
    }

    @Override
    public List<Question> searchErrorByUser(String userId) {
        return dataMapper.searchErrorByUser(userId);
    }

    @Override
    public List<Video> searchVideo(String type) {
        return dataMapper.searchVideo(type);
    }

    @Override
    public Detail detail(String id) {
        return dataMapper.detail(id);
    }

    @Override
    public List<Detail> searchAllDetail() {
        return dataMapper.searchAllDetail();
    }

    @Override
    public Detail searchByTitle(String title) {
        return dataMapper.searchByTitle(title);
    }

    @Override
    public List<Question> getAndroidQuestion(String type) {
        return dataMapper.getAndroidQuestion(type);
    }

    @Override
    public List<Question> selectAllAndroidQuestion() {
        return dataMapper.selectAllAndroidQuestion();
    }

    @Override
    public void addToAndroid(Question question) {
        dataMapper.addToAndroid(question);
    }

    @Override
    public void deleteToAndroid(Integer id) {
        dataMapper.deleteToAndroid(id);
    }

    @Override
    public Question searchAndroidQuestById(Integer id) {
        return dataMapper.searchAndroidQuestById(id);
    }

    @Override
    public void saveToAndroid(Question question) {
        dataMapper.saveToAndroid(question);
    }
}
